package com.lm.location.action;

import com.lm.location.dao.LocationDao;

public class ViewLocation extends LocationAction{
	
	public String viewLocation() throws Exception {
		System.out.println("deleted location................"+getLocationID());
		Location location = getLocationDetails();
		LocationDao locDao = new LocationDao();
		locDao.viewLocation(getLocationID());
		return SUCCESS;
	}
	
	public String getLocationToView() throws Exception {		
		System.out.println("edited location................"+getName());
		Location location = getLocationDetails();
		LocationDao locDao = new LocationDao();
		Location toViewLocation = locDao.viewLocation(getLocationID());
		setGetLocationToEdit(toViewLocation);
		//setLocationID(locationToEdit.getLocationID());
		setLocationCode(toViewLocation.getLocationCode());
		setName(toViewLocation.getName());
		setCategory(toViewLocation.getCategory());
		setAddress(toViewLocation.getAddress());
		setBlock(toViewLocation.getBlock());
		setDistrict(toViewLocation.getDistrict());
		setState(toViewLocation.getState());
		setCountry(toViewLocation.getCountry());
		setLandarea(toViewLocation.getLandarea());
		setLandterm(toViewLocation.getLandterm());
		setLandtype(toViewLocation.getLandtype());
		setRunningft(toViewLocation.getRunningft());
		setCoveredarea(toViewLocation.getCoveredarea());
		setRegisteredname(toViewLocation.getRegisteredname());
		setRegisterationno(toViewLocation.getRegisterationno());
		setRegistereddate(toViewLocation.getRegistereddate());
		setSubregistrar(toViewLocation.getSubregistrar());
		setEstvalue(toViewLocation.getEstvalue());
		setStmpexp(toViewLocation.getStmpexp());
		setOtherexp(toViewLocation.getOtherexp());
		setRegholder(toViewLocation.getRegholder());
		setRegcopy(toViewLocation.getRegcopy());
		setBuildingmap(toViewLocation.getBuildingmap());
		setCanteenOption(toViewLocation.getCanteenOption());
		setLndmark(toViewLocation.getLndmark());
		setDistance(toViewLocation.getDistance());
		setResponsible(toViewLocation.getResponsible());
		setStatus(toViewLocation.getStatus());
		setBalance(toViewLocation.getBalance());
		System.out.println("location name-----: "+toViewLocation.getName());
		return SUCCESS;
	}
}